// 监听传递过来的消息
chrome.runtime.onMessage.addListener((message, editJson, sendResponse) => {
    if(message.type === 'editHeadAgent' || message.type === 'editHostAgent' || message.type === 'reSet'){
        console.log("开始更改")
        let data = message.data
        let rules = {
            removeRuleIds:[1],
            addRules:data
        }
        console.log(JSON.stringify(rules))
        chrome.declarativeNetRequest.updateDynamicRules(rules,()=>{})
    }
});